﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace octopus_project.enumeration {

    public enum Sprite : byte {
        STATUS_BOX = 0
        ///EMPIEZAN EN EL 40 LOS GENERICOS
    }

    public static class SpriteExtensions {

        static public Texture2D SpriteImage;
        static public int rectangleW = 118;
        static public int rectangleH = 69;


        public static Sprite getFromValue (byte tileTypeValue) {
            string name = Enum.GetName(typeof(Sprite), tileTypeValue);
            return (Sprite)Enum.Parse(typeof(Sprite), name);
        }

        static public Rectangle GetSourceRectangle (this Sprite tileType, PlayersColor playersColor = PlayersColor.UNDEFINED) {
            return new Rectangle((int)tileType * (int)rectangleH, (int)playersColor * (int)rectangleH, (int)(tileType+1) * (int)rectangleW, rectangleH);
        }
    }
}
